CREATE TABLE [dbo].[TCAMAR_OCIN]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[NU_AMAR] [dbo].[TD_VC_008] NOT NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[FE_AMAR] [dbo].[TD_DT_001] NOT NULL,
[NU_PROC] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TCAMAR_OC__NU_PR__3D5E1FD2] DEFAULT ((0)),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TCAMAR_OC__CO_US__3E52440B] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TCAMAR_OC__FE_US__3F466844] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TCAMAR_OC__CO_US__403A8C7D] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TCAMAR_OC__FE_US__412EB0B6] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TCAMAR_OCIN] ADD CONSTRAINT [PK__TCAMAR_O__DB895B806A11960F] PRIMARY KEY CLUSTERED  ([CO_EMPR], [NU_AMAR], [CO_UNID_CONC], [FE_AMAR], [NU_PROC]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TCAMAR_OCIN] ADD CONSTRAINT [FK__TCAMAR_OCIN__7350E786] FOREIGN KEY ([CO_EMPR], [CO_UNID_CONC], [NU_AMAR], [FE_AMAR]) REFERENCES [dbo].[TCAMAR_OCPR] ([CO_EMPR], [CO_UNID_CONC], [NU_AMAR], [FE_AMAR])
GO
